package cn.lixin.hrm.cllient;

import cn.lixin.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SystemFallBackFactory implements FallbackFactory<SystemFeignClient> {


    @Override
    public SystemFeignClient create(Throwable throwable) {
        return new SystemFeignClient() {
            @Override
            public AjaxResult getUserInfo(String username) {
                return AjaxResult.me().setSuccess(false).setMessage("获取信息失败");
            }
        };
    }
}